package com.jvyou.thread.d03instance;

import java.util.concurrent.Callable;

/**
 * @author 橘柚
 * @version 1.0-SNAPSHOT
 * @Date 2024/7/30 9:40
 * @Description Callable接口实现类
 */
public class CallableImpl implements Callable<Integer> {
    @Override
    public Integer call() {
        // 求1-100的和
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        return sum;
    }
}
